package com.lss.myapplication.db.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;
import androidx.room.Delete;

import com.lss.myapplication.db.Province;

import java.util.List;

@Dao
public interface ProvinceDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(Province province);

    @Update
    void update(Province province);

    @Delete
    void delete(Province province);

    @Query("SELECT * FROM province")
    List<Province> getAllProvinces();

    @Query("SELECT * FROM province WHERE id = :id")
    Province getProvinceById(int id);
}
